<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>新增保单</title>
		<link href="../style/main.css" rel="stylesheet" type="text/css" />
		<link type="text/css" rel="stylesheet" href="../style/style.css" />
		<script type="text/javascript" src="../Scripts/validator.js">
</script>
		<style>
body {
	padding: 10px
}
</style>

		<script src="<%=basePath%>/Scripts/jquery-1.3.1.js"
			type="text/javascript">
		</script>
		<script src="<%=basePath%>/Scripts/jquery-ui-1.8.16.custom.min.js"
			type="text/javascript">
		</script>
		<script src="<%=basePath%>/Scripts/ui.datepicker-zh_CN.js"
			type="text/javascript">
		</script>
		<link href="<%=basePath%>/style/jquery-ui-1.8.16.custom.css"
			rel="stylesheet" type="text/css" />


		<script type="text/javascript">

function datePicker(pickerName, locale) {
	$(pickerName).datepicker($.datepicker.regional[locale]);
	$(pickerName).datepicker('option', 'changeMonth', true);//月份可调
	$(pickerName).datepicker('option', 'changeYear', true);//年份可调

}
$(document).ready(function() {
	datePicker('#insuranceDate', 'zh_CN');
	datePicker('#insuranceStartDate', 'zh_CN');
	datePicker('#insuranceEndDate', 'zh_CN');
});

function findClient() {
	alert("ddd");
	var clientId = $("#clientId").val();
	if (clientId == "")
		return;
	$.post("/WITAgent/policy/policyAction!findClientById.action", {
		"policy.client.clientId" : clientId
	}, function(data) {
		$("#clientName").val(data.toString());
	});
}
</script>
	</head>

	<body>
		<s:form action="policyAction!addPolicy" method="post" theme="simple"
			onsubmit="return Validator.Validate(this,1);">
			<div class="search">
				<table>
					<tr>
						<td>
							<table width="800" border="0" align="left" cellpadding="0"
								cellspacing="2" class="table4">
								<tr>
									<td width="100%" bgcolor="#BBD2F7" class="title">
										保单资料
									</td>
								</tr>
								<tr>
									<td bgcolor="#ffffff">
										<table cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<th width="11%" align="left">
													保单编号：
													<input name="insurancedef.insuranceId"
														value="<%=request.getParameter("insuranceId")%>"
														type="hidden" />
												</th>
												<td width="20%" align="left">
													<s:textfield name="policy.policyId" dataType="Require"
														msg="请输入保单编号" />
												</td>
												<th colspan="2" align="left">
													<s:checkbox name="policy.isLong" cssClass="check" />
													长险标志&nbsp;
												</th>
												<th align="left">
													保单状态：
												</th>
												<td align="left">
													<s:checkbox name="policy.isEffect" cssClass="check" />
													有效
													<s:checkbox name="policy.isAudit" cssClass="check" />
													未审核
												</td>
											</tr>
											<tr>
												<th align="left">
													客户编号：
												</th>
												<td align="left">
													<s:textfield name="policy.client.clientId"
														onchange="findClient()" id="clientId" />
												</td>
												<th colspan="2" align="left">
													<s:checkbox name="policy.isCountinue" cssClass="check" />
													续保
												</th>
												<td width="12%" align="left">
													&nbsp;
												</td>
												<td align="left">
													&nbsp;
												</td>
											</tr>
											<tr>
												<th align="left">
													被保险人：
												</th>
												<td align="left">
													<s:textfield name="policy.insurancedPerson" id="clientName" />
												</td>
												<th width="12%" align="left">
													投保日期：
												</th>
												<td align="left">
													<s:textfield name="policy.insuranceDate" id="insuranceDate"
														cssClass="txt_calendar" cssStyle="width: 60px"
														dataType="Require" msg="请输入投保日期">
														<s:param name="value">
															<s:date name="policy.insuranceDate" format="yyyy-MM-dd" />
														</s:param>
													</s:textfield>
												</td>
												<td align="left">
													&nbsp;
												</td>
												<td align="left">
													<s:checkbox name="policy.isLifetime" cssClass="check" />
													是否终身期限
												</td>
											</tr>
											<tr>
												<th align="left">
													受益人：
												</th>
												<td align="left">
													<s:textfield name="policy.benefitedPerson"
														dataType="Require" msg="请输入受益人" />
												</td>
												<th align="left">
													保险期限：
												</th>
												<td colspan="3" align="left">
													<s:textfield name="policy.insuranceStartDate"
														id="insuranceStartDate" cssClass="txt_calendar"
														cssStyle="width: 60px">
														<s:param name="value">
															<s:date name="policy.insuranceStartDate"
																format="yyyy-MM-dd" />
														</s:param>
													</s:textfield>
													到
													<s:textfield name="policy.insuranceEndDate"
														id="insuranceEndDate" cssClass="txt_calendar"
														cssStyle="width: 60px">
														<s:param name="value">
															<s:date name="policy.insuranceEndDate"
																format="yyyy-MM-dd" />
														</s:param>
													</s:textfield>
												</td>
											</tr>
											<tr>
												<td width="11%" align="left">
													总保费：
												</td>
												<td width="20%" align="left">
													<s:textfield name="policy.sumFee" dataType="Require"
														msg="请输入标准总保费" />
												</td>
												<td width="12%" align="left">
													&nbsp;
												</td>
												<td width="17%" align="left">
													&nbsp;
												</td>
												<td width="12%" align="left">
													&nbsp;
												</td>
												<td width="28%" align="left">
													&nbsp;
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table width="100%" border="0" align="left" cellpadding="0"
								cellspacing="2" class="table5">
								<tr>
									<td width="100%" bgcolor="#BBD2F7" class="title">
										详细资料
									</td>
								</tr>
								<tr>
									<td valign="top" class="fjxx_left">
										<table width="98%" border="0" align="center" cellpadding="0"
											cellspacing="2" class="bor">
											<tr>
												<td width="9%">
													缴费期限：
												</td>
												<td width="22%">
													<s:textfield name="policy.expendPeriod" dataType="Require"
														msg="请输入缴费期限" />
													年
												</td>
												<td width="11%">
													领取方式：
												</td>
												<td width="28%">
													<s:textfield name="policy.getWay" dataType="Require"
														msg="请输入领取方式" />
												</td>
												<td width="13%">
													投保份数：
												</td>
												<td width="17%">
													<s:textfield name="policy.amount" dataType="Require"
														msg="请输入投保份数" />
												</td>
											</tr>
											<tr>
												<td>
													缴费方式：
												</td>
												<td>
													<select name="policy.expendWay">
														<option value="年缴">
															年缴
														</option>
													</select>
												</td>
												<td>
													分红方式：
												</td>
												<td>
													<s:textfield name="policy.shareWay" dataType="Require"
														msg="请输入分红方式" />
												</td>
												<td>
													&nbsp;
												</td>
												<td>
													&nbsp;
												</td>
											</tr>
											<tr>
												<td width="9%">
													&nbsp;
												</td>
												<td width="22%">
													&nbsp;
												</td>
												<td width="11%">
													业务来源：
												</td>
												<td width="28%">
													<s:textfield name="policy.sourceId" dataType="Require"
														msg="请输入业务来源" />
												</td>
												<td>
													&nbsp;
												</td>
												<td>
													&nbsp;
												</td>
											</tr>
											<tr>
												<td>
													业 务 员：
												</td>
												<td>
													<s:textfield name="policy.employee.employeeId"
														value="%{#session.employee.employeeId}" dataType="Require"
														msg="请输入业务员" />
												</td>
												<td>
													来源说明：
												</td>
												<td>
													<s:textfield name="policy.sourceDesc" dataType="Require"
														msg="请输入来源说明" />
												</td>
												<td>
													&nbsp;
												</td>
												<td>
													&nbsp;
												</td>
											</tr>

										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table width="100%" border="0" align="left" cellpadding="0"
								cellspacing="2" class="table5">
								<tr>
									<td valign="top" class="fjxx_left">
										<table width="100%" cellpadding="0" cellspacing="0"
											class="table3">
											<tr>
												<td align="center">
													<s:submit value="保 存" cssStyle="width:60px; height:20px;" />
													&nbsp;&nbsp;&nbsp;&nbsp;
													<s:reset value="取消" cssStyle="width:60px; height:20px;" />
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
		</s:form>
	</body>
</html>
